﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "clearpathDB.h"
#include "deviceoperator.h"
#include "savepathdialog.h"
#include <QSqlTableModel>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
private slots:
    void on_serviceAddDelBtn_clicked();
    void on_serviceStartStopBtn_clicked();
    void on_serviceRestartBtn_clicked();
    void on_tableView_customContextMenuRequested(const QPoint &pos);

public slots:
    void getServerState();
    void addPath();
    void upPath();
    void delPath();
    void slot_saveClearPath(int saveType,ClearPath clearPath);
private:
    Ui::Widget *ui;
    ClearPathDB clearPathDB;
    QSqlTableModel *model;
    DeviceOperator deviceOperator;
    int serverState;
    QString serverName,serverDescription,serverPath;
    QTimer m_timer;
    SavePathDialog *savePathDialog;
};
#endif // WIDGET_H
